package com.kaizzi.data.common.utils;

import com.kaizzi.data.jdl.model.CommentsModel;
import com.kaizzi.data.jdl.model.ExcelModel;

/**
 * @author Kzen
 * @Description description
 * @date 2020/9/14
 */
public class LogicUtil {

    private static final String TITLE = "title";

    /**
     * @param model excelModel
     * @param page 页数
     * @return title
     */
    public static String getTitle(ExcelModel model,int page){
        for (CommentsModel comment:model.getComments()) {
            if (comment.getPage().equals("P"+page)){
                if (comment.getName().equals(TITLE)){
                    return comment.getData();
                }
            }
        }
        return null;
    }

    public static String getContent(ExcelModel model,int page,String param){
        for (CommentsModel comment:model.getComments()) {
            if (comment.getPage().equals("P"+page)){
                if (comment.getName().equals(param)){
                    return comment.getData();
                }
            }
        }
        return "";
    }

}
